from flask import Blueprint
from flask import request
from flask import make_response, jsonify
from flask_restplus import Api, Resource

login_api = Blueprint("login_api", __name__, url_prefix="/api/1/Login")
api = Api(login_api, title="login_api", version="1.0")
ns = api.namespace("ns")


@ns.route("/login")
@ns.param("user")
class LoginView(Resource):

    @api.doc(get=('filter',{'user':'user'}))
    def get(self):
        user = request.values.get("user")
        data = {"user": user}
        res = {"code": 200, "msg": "OK", "data": data}
        res = make_response(jsonify(res))
        return res
